﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace AntsCode.StorageClientExtensions.Denormalization
{
    public class DenormalizationRule
    {
        public DenormalizationRule(
            Type sourceType,
            Type destinationType,
            object[] sourceProperties,
            object[] destinationProperties,
            object filter,
            object reverseFilter,
            bool runAsync,
            object onDenormalized = null,
            object onReverseDenormalized = null)
        {
            this.SourceType = sourceType;
            this.DestinationType = destinationType;
            this.SourceProperties = sourceProperties;
            this.DestinationProperties = destinationProperties;
            this.Filter = filter;
            this.ReverseFilter = reverseFilter;
            this.RunAsync = runAsync;
            this.OnDenormalized = onDenormalized;
            this.OnReverseDenormalized = onReverseDenormalized;
        }

        public Type SourceType { get; private set; }
        public Type DestinationType { get; private set; }
        public object SourceProperties { get; private set; }
        public object DestinationProperties { get; private set; }
        public object Filter { get; private set; }
        public object ReverseFilter { get; private set; }
        public bool RunAsync { get; private set; }
        public object OnDenormalized { get; private set; }
        public object OnReverseDenormalized { get; private set; }
    }

    public delegate void DenormalizedDelegate<TSource, TDestination>(TSource sourceEntity, TDestination destEntity);
}